<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Db extends Admin_Controller
{
	private static $data = array();
	public function __construct()
	{
		parent::__construct();
		
	}

	//加载页面
	public function index()
	{	    
	    $this->load->view('admin/db/db.html');
	}
	//获取资讯列表数据
    public function download(){
        $this->load->dbutil();
        
        // Backup your entire database and assign it to a variable
        $backup = $this->dbutil->backup();
        
        //将数据库文件存储在服务器中
        /* $this->load->helper('file');
        write_file('/path/to/mybackup.gz', $backup); */
        
        // 下载数据库文件
        $this->load->helper('download');
        force_download('mysql.sql.gz', $backup,true);
    }
    
}
/* End of file Login.php */